<?php
/**
 * 示例model（标注表的作用）
 * panglishan
 * 2020.08.13
 */
namespace App\Models\MainDB;

use Illuminate\Database\Eloquent\Model;

class RoomReport extends Model{

    protected $table = 'ln_room_report';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名

    protected $fillable = [
        'id',      //主键ID
        'user_id',         //操作用户id
        'room_id',         //被举报房间id
        'remark',         //举报理由
        'picture',         //图片
        'add_time',         //创建时间
    ];

    public $timestamps = false;

    public function user () {
        return $this->hasOne("App\Models\MainDB\User", "user_id", "user_id");
    }

    public function room () {
        return $this->hasOne("App\Models\MainDB\UserRoom", "id", "room_id");
    }
}